package com.lht.designPattern.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-06-13
 */
public class Teacher implements Observer {

    private String  name;

    public Teacher(){
        this(null);
    }

    public Teacher(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println(name+"听到打铃了，去教室了");
    }
}
